package 数据结构.conllection;

import java.util.LinkedList;

/**
 * 自定义LinkList
 *
 * @author huangzhi*/
public class HzLinkedList {
    private Node first;
    private Node last;

    private int size;

    @Override
    public String toString() {
        return "HzLinkedList{" +
                "first=" + first +
                ", last=" + last +
                ", size=" + size +
                '}';
    }

    public void add(Object obj){
        Node node = new Node(obj);
        if (first == null) {
            first=node;
            last = node;
        }else {
            node.previous=last;
            node.next =null;
            last = node;
        }
    }

    public static void main(String[] args) {
     HzLinkedList hz = new HzLinkedList();
        LinkedList linkedList = new LinkedList();
        linkedList.add("aa");
     hz.add("ss");
     hz.add("ff");
     hz.add("gg");

        System.out.println(hz);


    }
}
